// The contents of this file are subject to the Mozilla Public License Version
// 1.1
//(the "License"); you may not use this file except in compliance with the
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
//
//Software distributed under the License is distributed on an "AS IS" basis,
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
//for the specific language governing rights and
//limitations under the License.
//
//The Original Code is "The Columba Project"
//
//The Initial Developers of the Original Code are Frederik Dietz and Timo
// Stich.
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
//
//All Rights Reserved.
package org.columba.addressbook.facade;


/**
 * Convenience class implementation of IContactItem. This implementation class can be used by clients
 * of the addressbook facade if desired, or can be implemented differently, if necessary.
 */
public class ContactItem extends HeaderItem implements IContactItem {

	private String firstName;
	private String lastName;
	private String address;
	
	public ContactItem() {
		super(true);
	}
	
	public ContactItem(String id) {
		super(id, true);
	}
	
	/**
	 * 
	 * @param id		unique id as generated by the contact store
	 * @param name		display name, as seen as "Sort as" in the contact editor dialog
	 * @param firstName optional firstName, can be <code>null</code>
	 * @param lastName  optional lastName, can be <code>null</code>
	 * @param address   email address
	 */
	public ContactItem(String id, String name, String firstName, String lastName, String address) {
		super(id, true);
		
		if ( name == null )  throw new IllegalArgumentException("name == null");
		if ( address == null )  throw new IllegalArgumentException("address == null");
		
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		
		setName(name);
		
	}
	
	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getEmailAddress() {
		return address;
	}
	

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setEmailAddress(String emailAddress) {
		this.address = emailAddress;
	}
}
